#ifndef VM_SWAP_H
#define VM_SWAP_H

#include <stddef.h>
#include "devices/block.h"
#include "threads/synch.h"

/* Initializes the swap table. */
void swap_table_init(void);

/* Swaps out a page to the swap partition and returns its swap index. */
size_t swap_out(void *kpage);

/* Swaps in a page from the swap partition. */
void swap_in(size_t swap_index, void *kpage);

/* Frees a swap slot. */
void swap_free(size_t swap_index);

#endif /* vm/swap.h */
